//
//  EventRewardInfo.m
//  SpaceStorm
//
//  Created by 祥 雍 on 13-5-26.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//
//  事件奖励表的信息类

#import "EventRewardInfo.h"
#import "Variable.h"

@implementation EventRewardInfo

@synthesize chapterId = _chapterId;
@synthesize baseMeritoriousMilitary = _baseMeritoriousMilitary;
@synthesize baseMilitarySupplies = _baseMilitarySupplies;
@synthesize smallBattleProbability = _smallBattleProbability;
@synthesize smallBattleId = _smallBattleId;
@synthesize middleBattleProbability = _middleBattleProbability;
@synthesize middleBattleId = _middleBattleId;
@synthesize bigBattleProbability = _bigBattleProbability;
@synthesize bigBattleId = _bigBattleId;
@synthesize bossBattleProbability = _bossBattleProbability;
@synthesize bossBattleId = _bossBattleId;
@synthesize salveProbability = _salveProbability;
@synthesize salveId = _salveId;

+(id) infoWithTbxml:(TBXMLElement *)tbxml
{
    return [[[self alloc] initWithTbxml:tbxml] autorelease]; 
}

-(id) initWithTbxml:(TBXMLElement *)tbxml
{
    self = [super init]; 
	
	if (self!= nil) 
    {
        //关卡ID	
        self.chapterId = [[TBXML valueOfAttributeNamed:@"chapterId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"关卡ID:%d", self.chapterId);
        
        //基础战功
        self.baseMeritoriousMilitary = [[TBXML valueOfAttributeNamed:@"baseMeritoriousMilitary" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"基础战功:%d", self.baseMeritoriousMilitary);
        
        //基础军需	
        self.baseMilitarySupplies = [[TBXML valueOfAttributeNamed:@"baseMilitarySupplies" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"基础军需:%d", self.baseMilitarySupplies);
        
        //弱战斗概率	
        self.smallBattleProbability = [[TBXML valueOfAttributeNamed:@"smallBattleProbability" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"弱战斗概率:%d", self.smallBattleProbability);
        
        //弱战斗id	
        self.smallBattleId = [[TBXML valueOfAttributeNamed:@"smallBattleId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"弱战斗id:%d", self.smallBattleId);
        
        //中战斗概率	
        self.middleBattleProbability = [[TBXML valueOfAttributeNamed:@"middleBattleProbability" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"中战斗概率:%d", self.middleBattleProbability);
        
        //中战斗id	
        self.middleBattleId = [[TBXML valueOfAttributeNamed:@"middleBattleId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"中战斗id:%d", self.middleBattleId);
        
        //强战斗概率	
        self.bigBattleProbability = [[TBXML valueOfAttributeNamed:@"bigBattleProbability" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"强战斗概率:%d", self.bigBattleProbability);
        
        //强战斗id	
        self.bigBattleId = [[TBXML valueOfAttributeNamed:@"bigBattleId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"强战斗id:%d", self.bigBattleId);
        
        //BOSS战斗概率	
        self.bossBattleProbability = [[TBXML valueOfAttributeNamed:@"bossBattleProbability" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"BOSS战斗概率:%d", self.bossBattleProbability);
        
        //BOSS战id	
        self.bossBattleId = [[TBXML valueOfAttributeNamed:@"bossBattleId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"BOSS战id:%d", self.bossBattleId);
        
        //打捞概率
        self.salveProbability = [[TBXML valueOfAttributeNamed:@"salveProbability" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"打捞概率:%d", self.salveProbability);
        
        //打捞id
        self.salveId = [[TBXML valueOfAttributeNamed:@"salveId" forElement:tbxml] intValue];
        if(showXMLLog == YES) CCLOG(@"打捞id:%d", self.salveId);
    }
    
    return self;
}

@end
